<script>
$(function(){
    $('#form').submit(function(){
		$.post(location.href,$(this).serialize(),function(data){			
			alert(data.message);
			if(data.state == 1) window.location.reload();
		},'json');
        return false;
    });

	
	$('#receive_name').autocomplete('?app=<?=APP?>&mod=<?=MOD?>&opt=getuser',{
		multiple:false,
		width:150,
		multipleSepartator:'',
		dataType:'json',
		minChars:0,
		parse: function(data) {
			var rows = [];
			for (var i=0; i<data.length ;i++ )
			{
				rows[rows.length] = {
					data: data[i].username,
					value: data[i].username,
					result:data[i].username
				};
			}
			return rows;
		},
		formatItem: function(row,i,n) {
			return row;
		},
		formatResult: function(row,i,n) {
			return row;
		},
		formatMatch: function(row,i,max) {
			return row;
		}
	});
});
</script>
<style>
.ac_results {
	padding: 0px;
	border: 1px solid black;
	background-color: white;
	overflow: hidden;
	z-index: 99999;
}

.ac_results ul {
	width: 100%;
	list-style-position: outside;
	list-style: none;
	padding: 0;
	margin: 0;
}

.ac_results li {
	margin: 0px;
	padding: 2px 5px;
	cursor: default;
	display: block;
	/* 
	if width will be 100% horizontal scrollbar will apear 
	when scroll mode will be used
	*/
	/*width: 100%;*/
	font: menu;
	font-size: 12px;
	/* 
	it is very important, if line-height not setted or setted 
	in relative units scroll will be broken in firefox
	*/
	line-height: 16px;
	overflow: hidden;
}

.ac_loading {
	background: white url('indicator.gif') right center no-repeat;
}

.ac_odd {
	background-color: #eee;
}

.ac_over {
	background-color: #0A246A;
	color: white;
}
</style>
<div class="line_1"></div>
<form id="form" method="post">


<div class="list-div" style="margin-bottom: 5px">
    <table cellspacing="1" width="100%">
        <tr><th colspan="4">发送平台消息</th></tr>
        <tr>
            <td align="right" width="120px"><strong>接收方：</strong></td>
            <td><input type="text" id="receive_name" name="receive_name" value="<?=$_GET['username']?>" /></td>
        </tr>
        <tr>
            <td align="right" width="120px"><strong>信息内容：</strong></td>
            <td>
				<textarea name="content" style="width:500px;height:200px"></textarea>
			</td>
        </tr>
        <tr>
            <td align="right" width="120px"><strong>&nbsp;</strong></td>
            <td><input type="submit" value="提交" /></td>
        </tr>
    </table>
</div>
</form>